import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  app: {
    rootId: 'app', // 修改默认的 __nuxt
    rootTag: 'div' // 还可以修改根元素的标签名
  },
  ssr:true,
  compatibilityDate: '2025-07-15',
  devtools: { enabled: true },
  $production: {
    routeRules: {
      '/**': { isr: true },
      // 60 秒
      '/api/*': { cache: { maxAge: 60 } },
      
    }
  },
  $development: {
    //
  },
  $env: {
    staging: {
      // 
    }
  },
  build: {
    // transpile: ['vuetify'],
  },
  css: [
    // 'vuetify/lib/styles/main.css',
    'element-plus/theme-chalk/dark/css-vars.css',
    // 'element-plus/dist/index.css',
    // '@mdi/font/css/materialdesignicons.css' // 如果你使用 Material Design 图标
  ],
  modules: [
    // (_options, nuxt) => {
    //   nuxt.hooks.hook('vite:extendConfig', (config) => {
    //     // @ts-expect-error
    //     config.plugins.push(vuetify({ autoImport: true }))
    //   })
    // },
    '@element-plus/nuxt'
    //...
  ],
  experimental: {
    payloadExtraction: true
  },
  vite: {
    vue: {
      template: {
        transformAssetUrls,
      },
    },
  },
})
